package org.grayrabbit.cloud.core.module;

import org.apache.commons.lang.StringUtils;
import org.grayrabbit.cloud.core.biz.BizChannelModule;
import org.grayrabbit.cloud.core.biz.ServerUtility;
import org.grayrabbit.cloud.core.config.ConfiguratorException;


public class ServerChannelModule extends BizChannelModule {
	private String url;
	public ServerChannelModule(){
		
	}
	public ServerChannelModule(String remoteAddr) {
		this.url = remoteAddr;
	}

	@Override
	public String getChannelUrl() {
		if(StringUtils.isNotBlank(this.url))
			return this.url;
		try {
			return ServerUtility.getProperty("module", name, "url");
		} catch (ConfiguratorException e) {
		}
		return null;
	}

}
